package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.hires.entity.DictCityDO;
import cn.iocoder.yudao.hires.vo.DictCityPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 行政区划 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface DictCityMapper extends BaseMapperX<DictCityDO> {

    default PageResult<DictCityDO> selectPage(DictCityPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DictCityDO>().likeIfPresent(DictCityDO::getNodeName, reqVO.getNodeName()).eqIfPresent(DictCityDO::getCodeParent, reqVO.getCodeParent()).eqIfPresent(DictCityDO::getNodeLevel, reqVO.getNodeLevel()).orderByDesc(DictCityDO::getNodeCode));
    }

}